﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Target.cs" company="Concept Architecture">
//   (c) 2010 Muhammad Umer Farooq
// </copyright>
// <summary>
//   Defines the Target type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Hisaab.Client.Model
{
    using System;
    using System.ComponentModel;

    /// <summary>
    ///  Defines the <seealso cref="Target"/> type.
    /// </summary>
    public class Target : ModelBase, IDataErrorInfo
    {
        #region Data Member

        /// <summary>
        /// Member Field _id
        /// </summary>
        private int _id;

        /// <summary>
        /// Member field _title
        /// </summary>
        private string _title;

        /// <summary>
        /// Member field _tagId
        /// </summary>
        private int _tagId;

        /// <summary>
        /// Member field _accountId
        /// </summary>
        private int _accountId;

        /// <summary>
        /// Member field _amount
        /// </summary>
        private decimal _amount;

        /// <summary>
        /// Member field _targetType
        /// </summary>
        private int _targetType;

        /// <summary>
        /// Member field _targetDate
        /// </summary>
        private DateTime _targetDate;

        #endregion Data Member

        #region Properties

        /// <summary>
        /// Gets or sets the id.
        /// </summary>
        /// <value>The id.</value>
        public int Id
        {
            get
            {
                return _id;
            }

            set
            {
                RaisePropertyChangingEvent("Id");
                _id = value;
                RaisePropertyChangingEvent("Id");
            }
        }

        /// <summary>
        /// Gets or sets the title.
        /// </summary>
        /// <value>The title.</value>
        public string Title
        {
            get
            {
                return _title;
            }

            set
            {
                RaisePropertyChangingEvent("Title");
                _title = value;
                RaisePropertyChangingEvent("Title");
            }
        }

        /// <summary>
        /// Gets or sets the tag id.
        /// </summary>
        /// <value>The tag id.</value>
        public int TagId
        {
            get
            {
                return _tagId;
            }

            set
            {
                RaisePropertyChangingEvent("TagId");
                _tagId = value;
                RaisePropertyChangingEvent("TagId");
            }
        }

        /// <summary>
        /// Gets or sets the account id.
        /// </summary>
        /// <value>The account id.</value>
        public int AccountId
        {
            get
            {
                return _accountId;
            }

            set
            {
                RaisePropertyChangingEvent("AccountId");
                _accountId = value;
                RaisePropertyChangingEvent("AccountId");
            }
        }

        /// <summary>
        /// Gets or sets the amount.
        /// </summary>
        /// <value>The amount.</value>
        public decimal Amount
        {
            get
            {
                return _amount;
            }

            set
            {
                RaisePropertyChangingEvent("Amount");
                _amount = value;
                RaisePropertyChangedEvent("Amount");
            }
        }

        /// <summary>
        /// Gets or sets the type of the target.
        /// </summary>
        /// <value>The type of the target.</value>
        public int TargetType
        {
            get
            {
                return _targetType;
            }

            set
            {
                RaisePropertyChangingEvent("TargetType");
                _targetType = value;
                RaisePropertyChangingEvent("TargetType");
            }
        }

        /// <summary>
        /// Gets or sets the target date.
        /// </summary>
        /// <value>The target date.</value>
        public DateTime TargetDate
        {
            get
            {
                return _targetDate;
            }

            set
            {
                RaisePropertyChangingEvent("TargetDate");
                _targetDate = value;
                RaisePropertyChangingEvent("TargetDate");
            }
        }

        #endregion Properties

        #region Implementation of IDataErrorInfo

        /// <summary>
        /// Gets an error message indicating what is wrong with this object.
        /// </summary>
        /// <returns>
        /// An error message indicating what is wrong with this object. The default is an empty string ("").
        /// </returns>
        public string Error
        {
            get { return string.Empty; }
        }

        /// <summary>
        /// Gets the error message for the property with the given name.
        /// </summary>
        /// <returns>
        /// The error message for the property. The default is an empty string ("").
        /// </returns>
        /// <param name="columnName">The name of the property whose error message to get. </param>
        public string this[string columnName]
        {
            get { return string.Empty; }
        }

        #endregion Implementation of IDataErrorInfo
    }
}